<?php

namespace app\admin\controller;

use think\Request;
use think\Db;

class System extends AdminController
{
    // 站点设置
    public function index()
    {
    	$res = Db::name('site')->where(['siteId' => 1])->find();
        return $this->assign('res',$res)->fetch('common/site');
    }

    // 站点信息修改执行
    public function update(Request $request, $siteId)
    {
        $post = $request->post();
        $res = Db::table('xt_site')->where(['siteId' => $siteId])->update($post);
        if ( $res ) {
        	return $this->success('网站信息修改成功!');die;
        }else{
			return $this->error('网站信息修改失败!');die;
        }
    }

    // 短信配置
    public function smsConfig()
    {
        return $this->fetch('common/smsedit');
    }

}
